#pragma once

#include "TokenClassMetaManager.h"
#include "TypeInitializerBase.h"

namespace MOE
{
	namespace System
	{
		namespace NonIntrusive
		{
			// Initializes the ClassMeta for class T.
			// Must be called before a ClassMeta is created and used by rest of the code.
			template <class T>
			class InitializeType
			{
			public:
				static Core::ClassMeta* As(const Core::char8* className, Core::tSize elementSize)
				{
					TypeInitializerBase base(TypeToken<typename T>::Value());
					base.SetClassName(className);
					base.SetClassSize(elementSize);
					return base.CreateClassMeta(TokenClassMetaManager::GetInstance());
				}

				template <class Parent>
				static Core::ClassMeta* WithParent(const Core::char8* className, Core::tSize elementSize)
				{
					TypeInitializerBase base(TypeToken<typename T>::Value());
					base.SetParentClass(TypeToken<typename Parent>::Value());
					base.SetClassName(className);
					base.SetClassSize(elementSize);
					return base.CreateClassMeta(TokenClassMetaManager::GetInstance());
				}
			};
		}
	}
}
